const sql = require('mssql');
/**
 * 
 * 仓库系统登录 
 */
const pickGoodsLogin = async (ctx, next) => {
    const body = ctx.request.body;
    // let selectSql = `SELECT DLMC,BM,MC FROM BM_YG WHERE BM IN (SELECT BM FROM YG_QYFP WHERE status = 'T') AND DLMC = '${body.username}' AND MM = '${body.password}'`;
    let selectSql = `SELECT DLMC,BM,MC,BMBM FROM BM_YG WHERE DLMC = '${body.username}' AND MM = '${body.password}'`;
    let result = await sql.query(selectSql);
    if (result.rowsAffected[0] === 1) {
        ctx.body = { success: true, result: result.recordset[0] }
    } else {
        ctx.body = { success: false }
    }
}


module.exports = {
    'POST /pickGoodsLogin': pickGoodsLogin
}